<template>
  <div class="container">
    <div class="header">
      <img src="@/assets/menu/pc_new_logo.png" alt="">
    </div>
    <div class="border">
      <div>
        <span>用户注册</span>
        <div>
          <input class="input" name="text" placeholder="姓名" type="search" v-model="params.uname">
        </div>
        <div>
          <input class="input" name="text" placeholder="身份证" type="search" v-model="params.idcard" maxlength="18">
        </div>
        <div>
          <input class="input" name="text" placeholder="用户名" type="search" v-model="params.username">
        </div>
        <div>
          <input class="input" name="text" placeholder="手机号" type="search" v-model="params.phone" maxlength="11">
        </div>

        <div>
          <input class="input" name="text" placeholder="密码" type="search" v-model="params.password">
        </div>

        <div class="login" @click="Register">注册并登录</div>
      </div>
    </div>
  </div>

</template>
<script>
import { getRegisterAPI } from '@/api/getLoginAPI'
export default {
  name: 'HouseRentAnroll',

  data() {
    return {
      params: {
        uname: '',
        idcard: '',
        username: '',
        phone: '',
        password: ''
      }
    }
  },
  methods: {
    async Register() {
      const { data: res } = await getRegisterAPI(this.params)
      if (res.code === 20011) {
        this.$message({
          message: '注册成功',
          type: 'success'
        })
        this.$router.go(-1)
      } else {
        this.$message.error('注册失败，请重新按要求输入输入')
      }
    }
  },
  created() {}
}
</script>

<style lang="less" scoped>
.header {
  display: flex;
  justify-content: space-around;
  background: #fff;
  border-bottom: 5px solid #ff9180;
  width: 100%;
  height: 60px;
  z-index: 1;
}
.border {
  margin: auto;
  margin-top: 100px;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40em;
  height: 30em;
}
.border span {
  font-weight: 600;
  padding: auto;
  color: black;
}
.input {
  margin: 10px 0 10px 0;
  width: 300px;
  background-color: #f5f5f5;
  color: #242424;
  padding: 0.15rem 0.5rem;
  min-height: 40px;
  border-radius: 4px;
  outline: none;
  border: none;
  line-height: 1.15;
  box-shadow: 0px 10px 20px -18px;
}
input:focus {
  border-bottom: 2px solid #5b5fc7;
  border-radius: 4px 4px 2px 2px;
}

input:hover {
  outline: 1px solid lightgrey;
}
.login {
  text-align: center;
  line-height: 40px;
  font-weight: 600;
  color: #fff;
  background-color: #ff9180;
}
.enroll {
  margin-top: 5px;
  color: #ff9180;
}
.enroll a {
  text-decoration: none;
  color: #ff9180;
}
</style>
